import allure
from appium.webdriver.common.appiumby import AppiumBy

from .base import Base


class HomePage(Base):   # 首页
    # 通讯录
    __ADDRESS_BOOK_PAGE = (AppiumBy.XPATH, '//*[@text="通讯录"]')

    def goto_address_book_page(self):   # 去通讯录页
        with allure.step('去通讯录'):
            self.find_click(self.__ADDRESS_BOOK_PAGE)
            from .address_book_page import AddressBookPage
            return AddressBookPage(self.driver)
